<style>
    .setimg{
        margin:-2px 5px 0 0
    }
    .zhuan2{display:none; position:fixed;top:10px;left:40%;z-index:99999999;color:#fff; background: url(http://wap.hipaygo.cn/statics/images/zhuan-r.png) no-repeat center; background-size: 30px; height: 30px; width: 30px; cursor: pointer}
    .zhuan3{display:none; position:fixed;top:10px;right:40%;z-index:99999999;color:#fff;background: url(http://wap.hipaygo.cn/statics/images/zhuan-l.png) no-repeat center; background-size: 30px; height: 30px; width:30px; cursor: pointer}
    .zhuan4{display:none; position:fixed;top:15px;left:50%;z-index:99999999;color:#fff; margin-left: -56px;}
    .zhuan4 a{cursor: pointer}
</style>
<div class="row-fluid">
    <a style="border:1px solid #ccc" class="block-heading" data-toggle="collapse">列表数据</a>
    <div class="well">
        <div class="btn-toolbar">
            <form>
                <label style="display: inline;">用户名称：</label><input class="input input-medium" type="text" name="cust_name" value="<?=I('get.cust_name')?>" />
                <label style="display: inline;margin-left:10px">手机号码：</label><input class="input input-medium" type="text" name="cust_mobile" value="<?=I('get.cust_mobile')?>" />
                <label style="display: inline;margin-left:10px">审核状态：</label>
                <select name="is_check" style="width: 150px">
                    <option value="all" <if condition="I('get.is_check') eq 'all'">selected</if> >全部</option>
                    <option value="-1" <if condition="I('get.is_check') eq -1">selected</if> >待审核</option>
                    <option value="-2" <if condition="I('get.is_check') eq -2">selected</if> >待提交资料</option>
                    <option value="1" <if condition="I('get.is_check') eq 1">selected</if> >审核通过</option>
                </select>
                <input type="hidden" value="<?=I('get.res')?>" name="res" />
                <button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
            </form>

        </div>
        <hr>
        <table class="table">
            <thead>
            <tr>
                <th style="text-align:center;width:100px">序号id</th>
                <th style="text-align:center;width:170px">用户姓名</th>
                <th style="text-align:center;width:180px">手机号码</th>
                <th style="text-align:center;width:180px">店铺等级</th>
                <th style="text-align:center;width:180px">手持身份证照</th>
                <th style="text-align:center;width:180px">身份证号</th>
                <th style="text-align:center;width:140px">审核状态</th>
                <th style="text-align:center;width:130px">操作</th>
            </tr>
            </thead>
            <tbody>
            <?php if($getData){foreach($getData AS $key=>$val){ ?>
            <tr>
                <td style="text-align:center;vertical-align:middle;"><?=$val['cust_id']?></td>
                <td style="text-align:center;vertical-align:middle;"><a href="/order/index?cust_id=<?=$val['cust_id']?>"><?=$val['nickname'] ?: '-'?> / <?=$val['cust_realname'] ?: '-'?></a></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['cust_mobile'] ?></td>
                <td style="text-align:center;vertical-align:middle;">
                    <?php if(!$val['salelevel']){?>
                    <span class="label label-default">无权限</span>
                    <?php }elseif($val['salelevel'] == '1'){?>
                    <span class="label label-info" style="background-color:#D6D658">嗨呗专员</span>
                    <?php }elseif($val['salelevel'] == '2'){?>
                    <span class="label label-warning" style="background-color:#93D6CD">嗨呗经理</span>
                    <?php }elseif($val['salelevel'] == '3'){?>
                    <span class="label label-info" style="background-color:#B387CA">嗨呗总监</span>
                    <?php }?>
                </td>
                <td style="text-align:center;vertical-align:middle;">
                    <!--<a href="<?=transUrl($val['identity_img'])?>" target="_blank" >点击查看</a>-->
                    <a class="zhuan" href="<?=transUrl($val['identity_img'])?>" rel="lightbox[roadtrip]"><img src="<?=transUrl($val['identity_img'])?>" width="200" height="80" /></a>
                </td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['identity']?></td>
                <td style="text-align:center;vertical-align:middle;">
                    <if condition="$val['is_check'] eq 1">
                        <span class="label label-success">审核通过</span>
                    <elseif condition="$val['is_check'] eq -1"/>
                        <span class="label label-default">待审核</span>
                    <elseif condition="$val['is_check'] eq -2"/>
                        <span class="label label-warning">待提交审核</span>
                    <else/>
                        <span class="label label-default">已冻结</span>
                    </if>
                </td>
                <td style="text-align:center;vertical-align:middle;">
                    <if condition="$val['is_check'] eq -1">
                    <a class="btn btn-primary ifrm" style="padding: 2px 10px" href="javascript:void(0);" data-url="/saler/salercheck" data-width="400" data-height="250" data-toggle="modal" data-title="卖家审核" data-params="custid/{{$val.cust_id}}" >审核</a>
                    <!--<a class="ifrm btn btn-info" href="javascript:void(0)" data-url="/saler/salerCheck" style="padding: 0px 4px;" data-width="680" data-height="430" data-title="卖家审核" data-params="cust_id/<?=$val['cust_id']?>"><i class="icon-pencil"></i></a>&nbsp;&nbsp;-->
                    <else/>
                        -
                    </if>
                </td>
            </tr>
            <?php }}else{?>
            <tr><td style="text-align:center" colspan=8>暂无数据</td></tr>
            <?php }?>
            </tbody>
        </table>
        <span style="float:right;margin-top:-44px"><?=$page?></span>
    </div>
</div>
<div class="modal small hide fade" itav="0" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">处理结果</h3>
    </div>
    <div class="modal-body">
        <p class="error-text">
            <center>
                <select name="status" id="ostatus" style="width:180px">
                    <option value='1'>审核通过</option>
                    <option value='-2'>审核不通过</option>
                </select>
            </center>
        </p>
        <input type="hidden" value="0" class="setCashId" />
    </div>
    <div class="modal-footer">
        <button class="btn" id="setResult" data-dismiss="modal" aria-hidden="true">确定</button>
    </div>
</div>
<div class="zhuan2" title="顺时针选择"></div>
<div class="zhuan3" title="逆时针选择"></div>
<div class="zhuan4">
    <a class="zhuan4-a1">放大</a>　<a class="zhuan4-a2">原图</a>　<a class="zhuan4-a3">缩小</a>
</div>
<script>
    $(document).ready(function(){
       $('.zhuan').click(function(){
          $('.zhuan2').css('display','block');
          $('.zhuan3').css('display','block');
          $('.zhuan4').css('display','block')
       });
       $('.zhuan2').click(function(){
           $('.lb-outerContainer').css('transform','rotate(90deg)')
       })
       $('.zhuan3').click(function(){
           $('.lb-outerContainer').css('transform','rotate(-90deg)')
       })
       $('.zhuan4-a1').click(function(){
           $('.lb-outerContainer').css('transform','scale(1.5)')
       })
       $('.zhuan4-a2').click(function(){
           $('.lb-outerContainer').css('transform','scale(1)')
       })
       $('.zhuan4-a3').click(function(){
           $('.lb-outerContainer').css('transform','scale(0.8)')
       })
       $('#lightboxOverlay').click(function(){
           $('.zhuan2').css('display','none');
           $('.zhuan3').css('display','none');
           $('.zhuan4').css('display','none');
           $('.lb-outerContainer').css('transform','rotate(0deg)');
           $('.lb-outerContainer').css('transform','scale(1)')
       })
       $('#lightbox').click(function(){
           $('.zhuan2').css('display','none');
           $('.zhuan3').css('display','none');
           $('.zhuan4').css('display','none');
           $('.lb-outerContainer').css('transform','rotate(0deg)');
           $('.lb-outerContainer').css('transform','scale(1)')
       })
    })
</script>
<script>
    $(function(){
        $('#setApply').change(function(){
            if($(this).val() != '0'){
                var strs = <?=json_encode($jsonArr)?>;
                var html = '<select name="city" id="appCity" style="width:125px;margin-left:5px">';
                for(var i=0;i<strs[$(this).val()].length;i++){
                    html += '<option value="'+strs[$(this).val()][i]['city']+'">'+strs[$(this).val()][i]['city']+'('+strs[$(this).val()][i]['cnt']+')</option>';
                }
                html += '</select>';
                $('#appCity').remove();
                $(html).insertAfter($('#setApply'));
            <?php if(I('get.city')){?>
                    $('#appCity').val('<?=I('get.city')?>');
                <?php }?>
            }
        }).trigger('change');
        $('.decate').live('click',function(){
            if(!window.confirm('确认'+$(this).attr('title')+'吗 ?')){
                return false;
            }
            window.location = $(this).attr('href');
        });
        $('.setTag').click(function(){
            if(!window.confirm('确认'+$(this).attr('title')+'吗 ?')){
                return false;
            }
            window.location = $(this).attr('href');
        });

        $('.lineCount').click(function(){
            art.dialog.open('/index/level/ifm/1/',
                    {
                        id: 'SETCHOSEID',
                        width: '100%',
                        height: '100%',
                        left: '0%',
                        top: '0%',
                        fixed: true,
                        resize: false,
                        drag: false,
                        title: '用户等级'
                    });
        });
    })
</script>
<script type="text/javascript">
    $(function(){
        $('.icheck').click(function(){
            $('.setCashId').val($(this).attr('itv'));
        });
        $('#setResult').click(function(){
            if($('.setCashId').val()>0){
                art.dialog({
                    title: '',
                    lock: true,
                    background: '#333',
                    opacity: 0.87,
                    drag: false,
                    resize: false,
                    content: '<img src="/statics/arts/skins/icons/loading.gif" /> 处理中，请稍候..'
                });
                $.post('/saler/salerCheck',{'check':$('#ostatus :selected').val(),'custid':$('.setCashId').val()},function(data){
                    console.log(data);
                    var list = art.dialog.list;
                    for (var i in list) {
                        list[i].close();
                    };
                    if(data.code == 1){
                        showmsg('操作成功',data.code);
                    }else{
                        showmsg('操作失败',data.code);
                    }

                    //setTimeout(function(){location.reload();},1000);
                },'json');
            }
        });
    });
</script>